package ink.lovejinhu.leetcode;

/**
 * @author jinhu
 * created 2021-07-12 10:29
 */
public class Solution_0292 {
    /**
     * NIM游戏
     *
     * @param n
     * @return
     */
    public boolean canWinNim(int n) {
        if (n <= 3) return true;
        if (n == 4) return false;
        return !(canWinNim(n - 1) & canWinNim(n - 2) & canWinNim(n - 3));
    }

    public static void main(String[] args) {
        Solution_0292 solution_0292 = new Solution_0292();
        boolean b = solution_0292.canWinNim(5);
        System.out.println(b);
    }
}
